package com.itheima.fanxing;

import com.itheima.domain.Student;

/*

 */
public class Demo03 {
    public static void main(String[] args) {
        InterImpl1<String> impl1 = new InterImpl1<>();
        impl1.sing("给关晓彤的土味情话");
        InterImpl2 interImpl2 = new InterImpl2();
        interImpl2.sing(10);
        new Inter<Student>() {
            @Override
            public void sing(Student student) {
                System.out.println(student);
            }
        }.sing(new Student("luhan",28));
        ((Inter<String>) n->{
            System.out.println(n);
        }).sing("给吴亦凡的土味情话");
    }



}
interface  Inter<E>{

    void sing(E e);
}
//实现类也不把泛型说清楚
class InterImpl1<E> implements Inter<E>{


    @Override
    public void sing(E e) {
        System.out.println(e);
    }
}
//实现类直接把泛型说清楚
class InterImpl2 implements Inter<Integer>{

    @Override
    public void sing(Integer integer) {

    }
}